import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class DateConversionExample {
    public static void main(String[] args) {
        String dateString = "2022-01-01";
        String pattern = "yyyy-MM-dd";
        Locale locale = Locale.US;

        SimpleDateFormat sdf = new SimpleDateFormat(pattern, locale);
        try {
            Date date = sdf.parse(dateString);
            System.out.println("Converted date: " + date);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}